# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContainerAnalysis.V1alpha1.Model.CVSS do
  @moduledoc """
  Common Vulnerability Scoring System. This message is compatible with CVSS v2 and v3. For CVSS v2 details, see https://www.first.org/cvss/v2/guide CVSS v2 calculator: https://nvd.nist.gov/vuln-metrics/cvss/v2-calculator For CVSS v3 details, see https://www.first.org/cvss/specification-document CVSS v3 calculator: https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator

  ## Attributes

  *   `attackComplexity` (*type:* `String.t`, *default:* `nil`) - Defined in CVSS v3, CVSS v2
  *   `attackVector` (*type:* `String.t`, *default:* `nil`) - Base Metrics Represents the intrinsic characteristics of a vulnerability that are constant over time and across user environments. Defined in CVSS v3, CVSS v2
  *   `authentication` (*type:* `String.t`, *default:* `nil`) - Defined in CVSS v2
  *   `availabilityImpact` (*type:* `String.t`, *default:* `nil`) - Defined in CVSS v3, CVSS v2
  *   `baseScore` (*type:* `number()`, *default:* `nil`) - The base score is a function of the base metric scores.
  *   `confidentialityImpact` (*type:* `String.t`, *default:* `nil`) - Defined in CVSS v3, CVSS v2
  *   `exploitabilityScore` (*type:* `number()`, *default:* `nil`) - 
  *   `impactScore` (*type:* `number()`, *default:* `nil`) - 
  *   `integrityImpact` (*type:* `String.t`, *default:* `nil`) - Defined in CVSS v3, CVSS v2
  *   `privilegesRequired` (*type:* `String.t`, *default:* `nil`) - Defined in CVSS v3
  *   `scope` (*type:* `String.t`, *default:* `nil`) - Defined in CVSS v3
  *   `userInteraction` (*type:* `String.t`, *default:* `nil`) - Defined in CVSS v3
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :attackComplexity => String.t() | nil,
          :attackVector => String.t() | nil,
          :authentication => String.t() | nil,
          :availabilityImpact => String.t() | nil,
          :baseScore => number() | nil,
          :confidentialityImpact => String.t() | nil,
          :exploitabilityScore => number() | nil,
          :impactScore => number() | nil,
          :integrityImpact => String.t() | nil,
          :privilegesRequired => String.t() | nil,
          :scope => String.t() | nil,
          :userInteraction => String.t() | nil
        }

  field(:attackComplexity)
  field(:attackVector)
  field(:authentication)
  field(:availabilityImpact)
  field(:baseScore)
  field(:confidentialityImpact)
  field(:exploitabilityScore)
  field(:impactScore)
  field(:integrityImpact)
  field(:privilegesRequired)
  field(:scope)
  field(:userInteraction)
end

defimpl Poison.Decoder, for: GoogleApi.ContainerAnalysis.V1alpha1.Model.CVSS do
  def decode(value, options) do
    GoogleApi.ContainerAnalysis.V1alpha1.Model.CVSS.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ContainerAnalysis.V1alpha1.Model.CVSS do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
